package com.ruoyi.advantage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.advantage.mapper.AdvantageMapper;
import com.ruoyi.advantage.domain.Advantage;
import com.ruoyi.advantage.service.IAdvantageService;

/**
 * 企业优势Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-28
 */
@Service
public class AdvantageServiceImpl implements IAdvantageService
{
    @Autowired
    private AdvantageMapper advantageMapper;

    /**
     * 查询企业优势
     *
     * @param id 企业优势主键
     * @return 企业优势
     */
    @Override
    public Advantage selectAdvantageById(Long id)
    {
        return advantageMapper.selectAdvantageById(id);
    }

    /**
     * 查询企业优势列表
     *
     * @param advantage 企业优势
     * @return 企业优势
     */
    @Override
    public List<Advantage> selectAdvantageList(Advantage advantage)
    {
        return advantageMapper.selectAdvantageList(advantage);
    }

    /**
     * 新增企业优势
     *
     * @param advantage 企业优势
     * @return 结果
     */
    @Override
    public int insertAdvantage(Advantage advantage)
    {
        advantage.setCreateTime(DateUtils.getNowDate());
        return advantageMapper.insertAdvantage(advantage);
    }

    /**
     * 修改企业优势
     *
     * @param advantage 企业优势
     * @return 结果
     */
    @Override
    public int updateAdvantage(Advantage advantage)
    {
        advantage.setUpdateTime(DateUtils.getNowDate());
        return advantageMapper.updateAdvantage(advantage);
    }

    /**
     * 批量删除企业优势
     *
     * @param ids 需要删除的企业优势主键
     * @return 结果
     */
    @Override
    public int deleteAdvantageByIds(Long[] ids)
    {
        return advantageMapper.deleteAdvantageByIds(ids);
    }

    /**
     * 删除企业优势信息
     *
     * @param id 企业优势主键
     * @return 结果
     */
    @Override
    public int deleteAdvantageById(Long id)
    {
        return advantageMapper.deleteAdvantageById(id);
    }
}
